package com.at.controller;

import com.at.service.BlogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @author : code1997
 * @date :2020-10-2020/10/17 14:21
 */
@Controller
public class ArchiveShowController {
    @Autowired
    private BlogService blogService;

    @GetMapping("/archives")
    public String archives(Model model){
        model.addAttribute("blogCount", blogService.getBlogCount());
        model.addAttribute("archiveMap", blogService.archivesBlog());
        return "archives";
    }
}
